/*
 * Copyright:  2018 smarabbit studio.
 *
 *  Licensed under the Confluent Community License; you may not use this file
 *  except in compliance with the License.  You may obtain a copy of the License at
 *
 *  http://www.confluent.io/confluent-community-license
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 *  WARRANTIES OF ANY KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations under the License.
 *
 *  @作   者： 黄开晖 (117227773@qq.com)
 *  @日   期:  2021年9月8日
 */
package com.massyframework.beanskin.license.signature.wizard;

import javafx.application.Platform;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.image.ImageView;

/**
 * 提供上一步，下一步的控制器
 * @author huangkh
 *
 */
public abstract class Controller {
	
	private Wizard wizard;
	
	@FXML
	private Button btnExit;
	@FXML
	private ImageView imageView;

	/**
	 * 
	 */
	public Controller() {
	}
		
	/**
	 * 初始化
	 * @param wizard
	 */
	public final void init(Wizard wizard) {
		this.wizard = wizard;
		this.init();
	}
	
	/**
	 * 向导
	 * @return {@link Wizard}
	 */
	public Wizard getWizard() {
		return this.wizard;
	}
	
	@FXML
	protected void onExitClick(ActionEvent event) {
		if (event.getSource() == this.btnExit) {
			Platform.exit();
		}
	}
	
	/**
	 * 初始化
	 */
	protected abstract void init();
	
	/**
	 * 释放
	 */
	public abstract void destroy();
	
	/**
	 * 显示前处理
	 */
	public void beforeShow() {
		
	}
}
